package com.mycoupon.mycouponframework;

import com.mycoupon.mycouponframework.result.Result;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.*;

@SpringBootTest
class MycouponFrameworkApplicationTests {

    @Test
    void contextLoads() throws IOException {
        ObjectOutputStream objectOutputStream = new ObjectOutputStream( new FileOutputStream("D:\\text.out"));
        Student student = new Student();
        student.setAge(27);
        student.setName("jayWei");
        objectOutputStream.writeObject(student);
        objectOutputStream.flush();
        objectOutputStream.close();
    }


    @Test
    void contextLoads1() throws Exception {
        ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("D:\\text.out"));
        Student student = (Student) objectInputStream.readObject();
        System.out.println("age=" + student.getAge());
    }
}
